package com.molichuxing.services.infrastructure.dao;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.InvoiceBean;
import com.molichuxing.services.infrastructure.dto.request.create.InvoiceCreateDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 发票 Mapper 接口
 * </p>
 *
 * @author zhaopenghui
 * @since 2019-09-24
 */
public interface InvoiceMapper extends RootMapper<InvoiceBean> {

    /**
     * 根据订单获取发票
     *
     * @param orderCode
     * @return
     */
    List<InvoiceBean> getInvoiceByOrder(@Param("orderCode") Long orderCode);

    /**
     * 通过id修改
     *
     * @param ids
     * @return
     */
    int modifyByIds(@Param("ids") List<Integer> ids);

    /**
     * 根据条件分页查询count
     *
     * @param params
     * @return
     */
    long getPageCount(@Param("params") Map<String, Object> params);

    /**
     * 根据条件分页查询
     *
     * @param params
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<InvoiceBean> getPage(@Param("params") Map<String, Object> params, @Param("pageNum") int pageNum,
                              @Param("pageSize") int pageSize);

    /**
     * 通过ids获取发票
     *
     * @param ids
     * @return
     */
    List<InvoiceBean> getListByIds(@Param("ids") List<Integer> ids);

    /**
     * 通过状态获取数量
     *
     * @param status
     * @param ids
     * @return
     */
    int getCountByStatus(@Param("status") Integer status, @Param("ids") List<Integer> ids);

    /**
     * @param ids
     * @param status
     * @return
     */
    int modifyStatusById(@Param("ids") List<Integer> ids, @Param("status") Integer status);

    /**
     * 批量添加
     *
     * @param invoiceBeanList
     * @return
     */
    int createBatch(List<InvoiceBean> invoiceBeanList);

    /**
     * 修改发票状态
     *
     * @return
     */
    int modifyStatus();



    /**
     * 查询订单的数据
     * @return
     */
    List<InvoiceCreateDto> selectOrderData();

    List<InvoiceCreateDto> selectSubscribeOrderData();
}